#ifndef SHIP_H
#define SHIP_H

//includes------------------------------
#include <vector>
#include <list>
//#include "../worldata/mapObject.h"
using namespace std;
//defines-------------------------------
#define MAX_SHOTS 5
enum s_size{ss_small, ss_med, ss_large};
enum b_type{bt_fore = 0, bt_broad, bt_aft, bt_art, bt_cqb, bt_max};

//prototypes----------------------------
struct shot;
class voley;	//a grouping of shots
class batery;	//a weapon mount
class p_ship;	//a chasis to mount weps + eng
class shipLib;	//a struct to hold ship prototypes

//definitions---------------------------
struct shot{
	int damage;
	int prob;
};
class voley{
	public:
		//constructors
		voley();
                voley(voley* vol);
		~voley();

		//add vollies
		void add(voley* vol);
		void add(int shot, int prob);

		//access
		int  size   ();
		shot getTop ();
		shot popTop ();
	protected:
	private:
		list<shot> vol;
		
};
class batery{
	public:
		//constructors
		batery(int damage, int n_shots, int acc, int max_range, int min_range, int weight, b_type batLoc);
		batery(batery* bat);
		~batery();

		//actions
		voley* shoot(voley* prev = NULL);
	protected:
	private:
		int dam;
		int shots;
		int acc;
		int range[2];
		int weight;
};
class p_ship{
	public:
		//constructors
                p_ship();
                p_ship(int arm, int shd);
                p_ship(int arm, int shd, int ePow, int eSpd);
		~p_ship();

		//access
		batery* bat(b_type tp);
		int gWeight();

		//add parts
		void addBat(b_type type, int damage, int n_shots, int acc, int max_range, int min_range, int weight);
		void addBat(b_type type, batery* bat);
	protected:
	private:
		int armor;
		int shield;
		int tag;
                int bspeed;
                int epower;
                int weight;
		batery* bt[bt_max];
};
class shipLib{
	public:
		//constructors
		shipLib(int n_ships);
                void clean();
		~shipLib();

		//access
		int     size      ();
		void    protoShip (p_ship* shp);
		p_ship* protoShip (int i);
	protected:
	private:
		int nEntries;
		p_ship* shp;
};
#endif
